#pragma once

#include <stdint.h>

class CShmBlock
{
public:
    CShmBlock();
    virtual ~CShmBlock();

public:
    void Init(void *pBuf, uint64_t nLen);
    void *Alloc(int iLen);
    void Free(void *ptr);

    uint64_t GetUnuseLength() { return m_nLen - m_nCur; }

private:
    void *m_pBuf;
    uint64_t m_nLen;
    uint64_t m_nCur;
};
